﻿using System;
using Microsoft.VisualStudio.OLE.Interop;

namespace VsxTools.MenuCommandService
{
    public class ExecArgs
    {
        private readonly Guid _groupId;
        private readonly uint _commandId;
        private IntPtr _pvaIn;
        private IntPtr _pvaOut;

        public ExecArgs(Guid groupId, uint commandId)
        {
            _groupId = groupId;
            _commandId = commandId;
        }

        public Guid GroupId
        {
            get { return _groupId; }
        }

        public uint CommandId
        {
            get { return _commandId; }
        }

        public uint CommandExecOpt { get; set; }

        public IntPtr PvaIn
        {
            get { return _pvaIn; }
            set { _pvaIn = value; }
        }

        public IntPtr PvaOut
        {
            get { return _pvaOut; }
            set { _pvaOut = value; }
        }
    }

    public sealed class QueryStatusArgs
    {
        private readonly Guid _groupId;
        private OLECMD[] _commands;
        private IntPtr _pCmdText;

        public QueryStatusArgs(Guid groupId)
        {
            _groupId = groupId;
        }

        public Guid GroupId
        {
            get { return _groupId; }
        }

        public uint CommandCount { get; set; }

        public OLECMD[] Commands
        {
            get { return _commands; }
            set { _commands = value; }
        }

        public IntPtr PCmdText
        {
            get { return _pCmdText; }
            set { _pCmdText = value; }
        }

        public uint FirstCommandId
        {
            get { return _commands[0].cmdID; }
        }

        public uint FirstCommandStatus
        {
            get { return _commands[0].cmdf; }
            set { _commands[0].cmdf = value; }
        }
    }
}